package com.mc.algorithm;

public class FourtyThree {
	
	private static int[] res;
	private static int org;
	public static void prob(int number){
		res = new int[6*number-number+1];
		org = number;
		for(int i=0;i<res.length;i++)
			res[i]=0;
		
		for(int j=1;j<=6;j++)
			recurse(number, j);
		for(int k=0;k<res.length;k++){
			double ratio = res[k]/Math.pow(6, number);
			System.out.println(k+org+" "+ratio);
		}
			
	}
	public static void recurse(int current,int sum){
		if(current==1){
			res[sum-org]++;
		}
		else{
			for(int i=1;i<=6;i++){
				recurse(current-1, sum+i);
			}
		}
	}
	public static void main(String[] args) {
		FourtyThree.prob(5);
	}
}
